Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FT-853: Implement query rewrite for Searchlog responses #449

Merged
merged 6 commits into from
Dec 25, 2024
Merged

Conversation

vaibhavatlan
Copy link
Collaborator

@vaibhavatlan vaibhavatlan commented Dec 19, 2024

Implementing a query rewrite for a time-based pagination approach for search, known as bulk search, based on asset creation timestamps. This approach is used when the number of results exceeds the predefined threshold (i.e: 10,000 assets). Users can explicitly run this search by setting the optional keyword argument bulk=True in the search_log.search() methods.

  • Implementation
  • Local Testing
  • Unit Tests
  • Integration Tests

@vaibhavatlan vaibhavatlan self-assigned this Dec 21, 2024
@vaibhavatlan vaibhavatlan added the feature New feature or request label Dec 21, 2024
Copy link
Member

@Aryamanz29 Aryamanz29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

  • I made some changes to your unit and integration tests to ensure pagination is properly executed within the test cases. Previously, you were only asserting checks like this:
assert len(results.current_page()) == size
assert results.count == total_count

This isn't sufficient ^^ as we also need to iterate over the results and confirm that the iteration count == TOTAL_LOG_ENTRIES (as returned by the API response) ✅

Also, I noticed that several assertions were missing in your unit tests. For example, we should include assertions like:

assert mock_logger.call_count == 0
...
...
assert mock_api_caller._call_api.call_count == 2

We might need to update the audit unit and integration tests as well to follow the same approach ^^

@Aryamanz29 Aryamanz29 merged commit 0ee8f68 into main Dec 25, 2024
36 of 37 checks passed
@Aryamanz29 Aryamanz29 deleted the FT-853 branch December 25, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants